package com.cicadasmall.system.wrapper;


import cn.hutool.core.lang.Assert;
import com.cicadasmall.common.func.Fn;
import com.cicadasmall.common.utils.SpringContextUtils;
import com.cicadasmall.common.utils.WarpsUtils;
import com.cicadasmall.common.wrapper.EntityWrapper;
import com.cicadasmall.data.domain.AttrDO;
import com.cicadasmall.data.domain.AttrClassDO;
import com.cicadasmall.system.service.IAttrClassService;
import com.cicadasmall.system.vo.AttrClassVO;

import java.util.List;

public class AttrClassWrapper implements EntityWrapper<AttrClassDO, AttrClassVO> {

    private final static IAttrClassService attrClassService;

    static {
        attrClassService = SpringContextUtils.getBean(IAttrClassService.class);
    }

    public static AttrClassWrapper newBuilder() {
        return new AttrClassWrapper();
    }

    @Override
    public AttrClassVO entityVO(AttrClassDO entity) {
        Assert.isTrue(Fn.isNotNull(entity), AttrDO.class.getName() + " 对象不存在！");
        return WarpsUtils.copyTo(entity, AttrClassVO.class);
    }


    @Override
    public List<AttrClassVO> treeVO(List<AttrClassDO> list) {
        return null;
    }
}